----------------------------------Spell Variables--------------------------------------
SPELL.m_iSpellID = 15411 -- Whatever value you want as long as it doesn't override any other spells' IDs.
SPELL.m_iRange = 1024
SPELL.m_sName = "Mana Burst"
SPELL.m_sToolTip =	[[You unleash a quick
					burst of magic damage, 
					causing weak damage.]]
SPELL.m_sIcon = "devin/blackbetty/spells/mage/manablast.png"
SPELL.m_iCoolDown = 5
SPELL.m_iManaCost = 25
SPELL.m_bRequiresTarget = true
SPELL.m_iSpellType = SPELLTYPE_RANGEDAMAGE

---------------------------------------------------------------------------------------

function SPELL:Cast( pl, target )
	
	print("Casted "..self.m_sName.."!")
	
	local range = self.m_iRange
	
	if(target && target:IsValid() && target != pl) then
		if(pl:GetPos():Distance(target:GetPos()) < range)then
			pl:StopParticles()
			ParticleEffectAttach( "arcane_glow", PATTACH_POINT_FOLLOW, pl, pl:LookupAttachment("anim_attachment_RH"))
			self:Effect(pl, target)
			--self:ApplySpellMods(self, pl, target)
		end
	end
end

function SPELL:Effect(pl, target)

	local weapon = pl:GetWeapon("weapon_all")
	
	pl:DoAnimationEvent(ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE)
	pl:EmitSound("devin/blackbetty/weapons/castsounds/ShadowCast.wav", 150, 130+math.random(10,20))
	if(SERVER)then
		self:DealDamage(weapon.MinWeaponDamage*2, weapon.MaxWeaponDamage*2, pl, target, DMG_ENERGYBEAM)
		pl:EmitSound("devin/blackbetty/weapons/Exorcism.wav", 150, 80+math.random(10,30))
		ParticleEffect( "arcane_hit", target:GetPos() + Vector(0, 0, 32), Angle(0,0,0), pl )
		ParticleEffect( "pummel_hit", target:GetPos() + Vector(0, 0, 45), Angle(0,0,0), target )
	end
end




